﻿// CBase2Dlg.cpp: 实现文件
//

#include "pch.h"
#include "CBase2Dlg.h"
#include "afxdialogex.h"
#include "resource.h"



// CBase2Dlg 对话框

IMPLEMENT_DYNAMIC(CBase2Dlg, CDialogEx)

CBase2Dlg::CBase2Dlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_DIALOG_BASE_2, pParent)
{

}

CBase2Dlg::~CBase2Dlg()
{
}

void CBase2Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CBase2Dlg, CDialogEx)
	ON_WM_NCLBUTTONDOWN()
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	ON_WM_MOUSEMOVE()
END_MESSAGE_MAP()


// CBase2Dlg 消息处理程序


BOOL CBase2Dlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  在此添加额外的初始化

	this->MoveWindow(0, 600, 300, 300);
	bBD = FALSE;

	return TRUE;  // return TRUE unless you set the focus to a control
				  // 异常: OCX 属性页应返回 FALSE
}


void CBase2Dlg::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值

	CDialogEx::OnNcLButtonDown(nHitTest, point);
}


void CBase2Dlg::OnLButtonDown(UINT nFlags, CPoint point)
{
	bBD = TRUE;

	CDialogEx::OnLButtonDown(nFlags, point);
}


void CBase2Dlg::OnLButtonUp(UINT nFlags, CPoint point)
{
	bBD = FALSE;
	// TODO: 在此添加消息处理程序代码和/或调用默认值

	m_pViewController->GetMousePos();

	CDialogEx::OnLButtonUp(nFlags, point);
}


void CBase2Dlg::OnMouseMove(UINT nFlags, CPoint point)
{
	if (bBD == TRUE)
	{
		m_pViewController->ZoomChange(point);
	}
	

	// TODO: 在此添加消息处理程序代码和/或调用默认值

	CDialogEx::OnMouseMove(nFlags, point);
}
